Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat: Implement authentication and Authorization #2 #6

Merged
merged 2 commits into from
Jun 10, 2024
Merged

Conversation

jkarenzi
Copy link
Owner

what does this PR do?

  • This PR implements authentication and authorization.

Description of the task to be completed

  • Set up endpoints for user sign up and login
  • Define roles and permissions for normal users and admins
  • Implement an API endpoint for managing roles and permissions, and assigning new roles to users
  • Enforce role-based access control throughout the application
  • Implement appropriate error handling and responses
  • Write comprehensive unit tests

How can this be manually tested?

  • test login and signup routes by sending requests to the api/auth/login and api/auth/signup endpoints respectively.
  • use the authenticateToken middleware to protect routes
  • use the authorizeAdmin middleware to check roles

Swagger documentation screenshot
swagger

Test screenshot
tests

What are the relevant pivotal trackers/story id?

jkarenzi added 2 commits June 7, 2024 15:18
- implement endpoints for login and signup
- implemented middleware for authenticating token and also checking if a user has the necessary role s to access a route

[Delivers #2]
- implement endpoint for user signup and login
- implement middleware for authenticating jwt tokens
- implement role checking middleware

[Delivers #2]
@jkarenzi jkarenzi added the feature New feature or request label Jun 10, 2024
@jkarenzi jkarenzi added this to the Sprint 1 milestone Jun 10, 2024
@jkarenzi jkarenzi self-assigned this Jun 10, 2024
@jkarenzi jkarenzi linked an issue Jun 10, 2024 that may be closed by this pull request
6 tasks
Copy link

codecov bot commented Jun 10, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (30b434c) to head (0a098d3).

Additional details and impacted files
@@              Coverage Diff              @@
##           develop        #6       +/-   ##
=============================================
+ Coverage    77.77%   100.00%   +22.22%     
=============================================
  Files            2        10        +8     
  Lines            9        84       +75     
  Branches         0         5        +5     
=============================================
+ Hits             7        84       +77     
+ Misses           2         0        -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jkarenzi jkarenzi changed the title Ft auth #2 Feat: Implement authentication and Authorization #2 Jun 10, 2024
@jkarenzi jkarenzi merged commit c1d809f into develop Jun 10, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feat: Authentication and Authorization
1 participant